﻿using StarPizza.Model.BaseModel;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace StarPizza.Model.Core
{
    public delegate void ToppingStorageChangedEventHandler(Topping topping, int diff, int newAmount);
    public delegate void DoughStorageChangedEventHandler(Dough dough, int diff, int newAmount);
    public interface IIngredientResource
    {
        event Action<Topping> ToppingCreated;
        event ToppingStorageChangedEventHandler ToppingStorageChanged;
        event Action<Topping> OutOfTopping;
        event Action<Topping> ToppingBecameAvailable;

        event Action<Dough> DoughCreated;
        event DoughStorageChangedEventHandler DoughStorageChanged;
        event Action<Dough> OutOfDough;
        event Action<Dough> DoughBecameAvailable;

        int GetAmount(Ingredient ingredient);
        bool IsIngredientAvailable(Ingredient ingredient);
        bool IsPizzaTemplateOrderable(IPizzaTemplate pizzaTemplate);
        IEnumerable<Topping> GetToppings();
        IEnumerable<Dough> GetDoughs();
    }
}
